package cn.iocoder.yudao.module.trade.dal.mysql.depositorderlackbottlesrelation;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.trade.dal.dataobject.depositorderlackbottlesrelation.DepositOrderLackBottlesRelationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.trade.controller.admin.depositorderlackbottlesrelation.vo.*;

/**
 * 欠瓶记录对应瓶数据 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface DepositOrderLackBottlesRelationMapper extends BaseMapperX<DepositOrderLackBottlesRelationDO> {

    default PageResult<DepositOrderLackBottlesRelationDO> selectPage(DepositOrderLackBottlesRelationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DepositOrderLackBottlesRelationDO>()
                .eqIfPresent(DepositOrderLackBottlesRelationDO::getLackBottlesId, reqVO.getLackBottlesId())
                .eqIfPresent(DepositOrderLackBottlesRelationDO::getSkuId, reqVO.getSkuId())
                .likeIfPresent(DepositOrderLackBottlesRelationDO::getSkuName, reqVO.getSkuName())
                .eqIfPresent(DepositOrderLackBottlesRelationDO::getLackBottlesNum, reqVO.getLackBottlesNum())
                .eqIfPresent(DepositOrderLackBottlesRelationDO::getReturnBottlesNum, reqVO.getReturnBottlesNum())
                .eqIfPresent(DepositOrderLackBottlesRelationDO::getProductTypeId, reqVO.getProductTypeId())
                .betweenIfPresent(DepositOrderLackBottlesRelationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DepositOrderLackBottlesRelationDO::getId));
    }

}